package com.boot.learning.powermock;

import java.util.Random;

public class RandomStrUtils {

	
	public static String getRandomStr(int length) {
        String charList = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
        String rev = "";
        Random f = new Random();
        for(int i=0;i<length;i++)
        {
           rev += charList.charAt(Math.abs(f.nextInt())%charList.length());
        }
        System.err.println( String.format("随机生成[%s]位的字符串[%s]", length,rev) );
        return rev;
	}
}
